package protocol.vendasFuncionario;

import java.util.Vector;

import protocol.Response;
import util.StringTokenizer;

public class VendasFuncionarioResponse implements Response {

	private String response;
	private int coluna1;
	private String coluna1Label;
	private int coluna2;
	private String coluna2Label;
	private int coluna3;
	private String coluna3Label;
	
	public VendasFuncionarioResponse(String response) {
		this.response = response;
		
		Vector colunas = new StringTokenizer(response, ",").getTokens();
		this.coluna1Label = (String)colunas.elementAt(0);
		this.coluna2Label = (String)colunas.elementAt(1);
		this.coluna3Label = (String)colunas.elementAt(2);
		
		System.out.println(coluna1Label);
		System.out.println(coluna2Label);
		System.out.println(coluna3Label);
		
		colunas = new StringTokenizer(coluna1Label, ":").getTokens();
		this.coluna1 = Integer.parseInt((String)colunas.elementAt(1));
		this.coluna1Label = (String)colunas.elementAt(0);
		colunas = new StringTokenizer(coluna2Label, ":").getTokens();
		this.coluna2 = Integer.parseInt((String)colunas.elementAt(1));
		this.coluna2Label = (String)colunas.elementAt(0);
		colunas = new StringTokenizer(coluna3Label, ":").getTokens();
		this.coluna3 = Integer.parseInt((String)colunas.elementAt(1));
		this.coluna3Label = (String)colunas.elementAt(0);
	}

	public String getResponse() {
		return this.response;
	}
	
	public void setResponse(String response) {
		this.response = response;
	}

	public int getColuna1() {
		return coluna1;
	}

	public int getColuna2() {
		return coluna2;
	}

	public int getColuna3() {
		return coluna3;
	}

	public String getColuna1Label() {
		return coluna1Label;
	}

	public String getColuna2Label() {
		return coluna2Label;
	}

	public String getColuna3Label() {
		return coluna3Label;
	}

}
